package com.lu.behavior.service.impl;

import com.lu.behavior.service.ThumbsUpService;
import com.lu.common.redis.CacheService;
import com.lu.model.behavior.dto.LikesBehaviorDto;
import com.lu.model.common.dtos.ResponseResult;
import com.lu.model.common.enums.AppHttpCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;

public class ThumbsUpServiceImpl implements ThumbsUpService {

    @Autowired
    private CacheService cacheService;
    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 文章点赞
     * @param dto
     * @return
     */
    @Override
    public ResponseResult likeUp(LikesBehaviorDto dto) {
        if (dto == null) {
            return ResponseResult.errorResult(AppHttpCodeEnum.PARAM_INVALID);
        }
        //key存入redis  key = 文章id+类型+点赞
        String key = dto.getId() + "_" + dto.getType() + "_" + dto.getPoeration();
        return null;
    }
}
